package com.twd.lang;

import com.twd.lang.entity.LocaleLanguage;
import com.twd.lang.mapper.I18nMessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;

@SpringBootApplication(scanBasePackages = {"com.twd.lang"})
public class LangApplication implements CommandLineRunner, ApplicationListener<ContextClosedEvent> {

	@Autowired
	I18nMessageMapper messageMapper;
	public static void main(String[] args) {
		SpringApplication.run(LangApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {

	}

	@Override
	public void onApplicationEvent(ContextClosedEvent event) {
//		for (int i = 0; i < 10; i++) {
//			System.out.println("wwwwwww");
//			messageMapper.insert(new LocaleLanguage(i+"",i+i+"","zh_CN"));
//		}
	}
}
